Conversation
|
|
||
| $this->setDescription('Create a new migration') | ||
| ->addArgument('name', InputArgument::OPTIONAL, 'Class name of the migration (in CamelCase)') | ||
| ->addArgument('name', InputArgument::OPTIONAL, 'Class name of the migration (in PascalCase)') |
There was a problem hiding this comment.
Thats not a typo, the naming convention so far dictates:
- CamelCase
- camelBacked
as official wordings
https://book.cakephp.org/5/en/intro/conventions.html
PascalCase is just an alias that is much more uncommon in our circles and not clear to many (camel from the animal is).
There was a problem hiding this comment.
I guess strictly speaking it would be
UpperCamelCase
vs
lowerCamelCase
https://en.wikipedia.org/wiki/Camel_case
But we simplified that 20+ years ago and have that convention for 2 decades now using the above naming.
There was a problem hiding this comment.
ok, thanks a lot for the clarification and now i understand and share your convention. Wouldn't be useful to specify camedBacked to avoid confusion when reading the warning in the console?
There was a problem hiding this comment.
But the warning ist correct.
Or what do you want to change?
There was a problem hiding this comment.
My advice would be this: since the format of the name should be camelBacked as per convention it would be useful to specify it instead of saying camelCase. Today I've lost about 10 minutes trying to understand why it wasn't accepting the camelCase name of the class.
It's a minor change but it would make it clear what the format of the class should be.
There was a problem hiding this comment.
But it is supposed to be CamelCase and thats the message
|
"CamelCaseControllerName" is correct format. Closing. |
This pull request updates the naming convention for migration class names in the
Createcommand to use PascalCase instead of CamelCase. The changes ensure consistency in the format and provide clear guidance to users.Updates to naming convention:
src/Phinx/Console/Command/Create.php: Updated the argument description in theconfiguremethod to specify that the migration class name should be in PascalCase.src/Phinx/Console/Command/Create.php: Updated the error message in theexecutemethod to indicate that the migration class name must use PascalCase format.